    # = test.home.2.rb - Home , Navigate Home Page Links Test
    # 
    # See LICENSE.txt for licensing details.
    #
    # == Description
    # Here the test navigate to the links on the home page and   verified
require 'watir'
  include Watir    
  require 'test/unit'
  require '../watir.config.rb'

  class TC_TabBarNavigation_test < Test::Unit::TestCase
      
		def startup			
			@@ie = Watir::IE.start($SITE_URL)
		end
		
		def ie
			if defined? @@ie
			  @@ie
			else
			  startup
			end
		end
	  
	  def test_01_verifyHomePage
      assert(ie.contains_text(/Community Server/))			
    end
  
	  def test_02_verifyNavigationLinksExist   
      assert_equal $SITE_URL, ie.link(:text, 'Home').href
      assert_equal $SITE_URL + 'blogs/', ie.link(:text, 'Blogs').href
      assert_equal $SITE_URL +'forums/', ie.link(:text, 'Forums').href
      assert_equal $SITE_URL +'photos/', ie.link(:text, 'Photos').href
      assert_equal $SITE_URL +'files/', ie.link(:text, 'Downloads').href
    end
  
	  def test_03_verifyBlogsPage
      
      # Navigate to the blogs page and check for standard text items
      ie.link(:text, 'Blogs').click
      assert_match /Welcome to Community Server Blogs!/, ie.text
      assert_match /Blogs/, ie.text
    end
  
	  def test_04_verifyForumsPage
      # Navigate to the forums page and check for standard text items
      ie.link(:text, 'Forums').click
      assert_match /Discussions/, ie.text
      assert_match /Sample Forums /, ie.text
    end
  
	  def test_05_verifyPhotosPage
      # Navigate to the forums page and check for standard text items
      ie.link(:text, 'Photos').click
      assert_match /Recent Photos/, ie.text
      assert_match /Recent Additions/, ie.text
    end
  
	  def test_06_verifyDownloadsPage
      # Navigate to the forums page and check for standard text items
      ie.link(:text, 'Downloads').click
      assert_match /Files/, ie.text
      assert_match /Most Downloads/, ie.text
    end
  
	  def test_07_verifyBlogsPageLinksWork
      test_03_verifyBlogsPage		
      test_02_verifyNavigationLinksExist
      
      test_01_verifyHomePage
      test_03_verifyBlogsPage
      
      test_04_verifyForumsPage
      test_03_verifyBlogsPage
      
      test_05_verifyPhotosPage
      test_03_verifyBlogsPage
      
      test_06_verifyDownloadsPage
      test_03_verifyBlogsPage
	  end
	  
	  def test_08_verifyPhotosPageLinksWork
      test_05_verifyPhotosPage		
      test_02_verifyNavigationLinksExist
      
      test_01_verifyHomePage
      test_05_verifyPhotosPage
      
      test_04_verifyForumsPage
      test_05_verifyPhotosPage
      
      test_03_verifyBlogsPage
      test_05_verifyPhotosPage
      
      test_06_verifyDownloadsPage
      test_05_verifyPhotosPage
	  end
	  
	  def test_09_verifyForumsPageLinksWork
      test_04_verifyForumsPage		
      test_02_verifyNavigationLinksExist
      
      test_01_verifyHomePage
      test_04_verifyForumsPage
      
      test_05_verifyPhotosPage
      test_04_verifyForumsPage
      
      test_03_verifyBlogsPage
      test_04_verifyForumsPage
      
      test_06_verifyDownloadsPage
      test_04_verifyForumsPage
	  end
	  
	  def test_10_verifyDownloadsPageLinksWork
      test_06_verifyDownloadsPage		
      test_02_verifyNavigationLinksExist
      
      test_01_verifyHomePage
      test_06_verifyDownloadsPage
      
      test_05_verifyPhotosPage
      test_06_verifyDownloadsPage
      
      test_03_verifyBlogsPage
      test_06_verifyDownloadsPage
      
      test_04_verifyForumsPage
		test_06_verifyDownloadsPage
    end
  
    def test_99_closeIE
      ie.close
    end
	 
  end
